#ifndef SHCO_DISP_H
#define SHCO_DISP_H

struct SsKeyEvent
{
    int type;
    unsigned int state; /* key or button mask */
    unsigned int key;
    unsigned int cnt;
};

struct SsButtonEvent
{
    int type;
    int x, y;
    unsigned int state;
    unsigned int button; /* which button: left, right, middle */
};

struct SsMotionEvent
{
    int type;
    int x, y;
    unsigned int state;
};

struct SsWheelEvent
{
    int type;
    int x, y;
    unsigned int state;
    int delta;
};

union SsUiEvent
{
    int type;
    SsKeyEvent wkey;
    SsButtonEvent wbutton;
    SsMotionEvent wmotion;
    SsWheelEvent wwheel;
};

enum SsEventType
{
    S_NO_BTN = 0,
    S_BTN1_UP,         /* mouse button left up */
    S_BTN1_DN,         /* mouse button left down */
    S_BTN1_DC,         /* mouse button left double click */
    S_BTN2_UP,         /* mouse button middle up */
    S_BTN2_DN,         /* mouse button middle down */
    S_BTN2_DC,         /* mouse button middle double click */
    S_BTN3_UP,         /* mouse button right up */
    S_BTN3_DN,         /* mouse button right down */
    S_BTN3_DC,         /* mouse button right double click */
    S_KEY_UP,          /* keyboard up */
    S_KEY_DN,          /* keyboard down */
    S_MOUSE_MOVE,      /* mouse move */
    S_MOUSE_WHEEL,     /* mouse wheel */
    S_BUTTON_UP,
    S_BUTTON_DOWN,
    S_BUTTON_DCLICK,
    S_ENTER_NOTIFY,    /* mouse enter */
    S_LEAVE_NOTIFY,    /* mouse leave */
    S_LAST_EVENT       /* always be the last in this enum */
};

enum SsKeyboardModifier
{
    S_MASK_NULL = 0,
    S_MASK_LBUTTON = 0x0001,
    S_MASK_SHIFT = 0x0004,
    S_MASK_CONTROL = 0x0008,
    S_MASK_ALT = 0x0020
};

enum SeLineStyle
{
    S_LINE_NO = 0,
    S_LINE_SOLID = 1,
    S_LINE_DASH = 2,
    S_LINE_DOT = 3,
    S_LINE_DASH_DOT = 4,
    S_LINE_DASH_DOT_DOT = 5
};

enum SeLineCapStyle
{
    S_CAP_FLAT = 0,
    S_CAP_ROUND = 1,    // rounded line end
    S_CAP_SQUARE = 2
};

enum SeLineJoinStyle
{
    S_JOIN_BEVEL = 0,
    S_JOIN_MITER = 1,
    S_JOIN_ROUND = 2
};

struct SsColor
{
    int r, g, b, a;
};

struct SsWireAt
{
    SsColor color;
    SeLineStyle lineStyle;
    SeLineCapStyle capStyle;
    SeLineJoinStyle joinStyle;
    double width;
};

#endif // SHCO_DISP_H
